package com.java.tutorials.jdk7.fileoperation;

import com.java.tutorials.Constants;

import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * Created by xuzhike on 2016/1/25.
 * http://www.java2s.com/Code/Java/JDK-7/CopyingSymbolicLinks.htm
 * Copying Symbolic Links
 */
public class CopyingSymbolicLinks {
    public static void main(String[] args) throws Exception {
        Path originalLinkedFile = FileSystems.getDefault().getPath(Constants.TEST_FILE_WITH_PATH);
        Path newLinkedFile = FileSystems.getDefault().getPath(Constants.TEST_PATH+"users5.txt");
        Files.copy(originalLinkedFile, newLinkedFile);
        System.out.println("Symbolic link file copied successfully!");

    }
}
